#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include<iostream> 
using namespace std;
typedef struct node{
   int data;
   struct node *next;
}ListNode;
typedef ListNode *List;
void CreateList(List &L,int n);
void ReverseList(List &L);
void PrintList(List L);

int main()
{
       int n;
      List L;
      cin>>n;
     CreateList(L,n);
     ReverseList(L);
    PrintList(L);

 } 
void CreateList(List &L,int n){
 	int i;
 	ListNode *p,*q;
 	if(n==0) return;
	L = (ListNode *)malloc(sizeof(ListNode));
	q=L;
	for(i=0;i<n;i++){
		p=(ListNode *)malloc(sizeof(ListNode));
		cin>>p->data;
		q->next=p;
		q=p;
	}
	q->next=NULL;
 }
 void ReverseList(List &L){
 	int i=0,a[10000],j;
 	ListNode *p=L,*s;
 	while(p!=NULL){
 		a[i]=p->data;
 		p=p->next;
 		i++;
	 }
	 L=(ListNode *)malloc(sizeof(ListNode));
	 L->next=NULL;
	 for(j=0;j<i;j++){
	 	s=(ListNode *)malloc(sizeof(ListNode));
	 	s->data=a[j];
	 	s->next=L->next;
	 	L->next=s;
	 }
 }
 void PrintList(List L){
 	L = L->next;
 	if(L==NULL){
 		cout<<"NULL";
 		return;
	 } 
 	else{
 		cout<<L->data;
		L=L->next;	
		while(L->next!=NULL){
		cout<<" "<<L->data;
		L = L->next;
	 	}
	}

 }
